当前位置: 首页> 函数类别大全> timezone_open

timezone_open

DateTimeZone::__construct的别名 - 创建新的DateTimeZone对象
名称:timezone_open
分类:日期和时间
所属语言:php
一句话介绍:创建新的 DateTimeZone 对象。

定义和用法

timezone_open() 创建新的 DateTimeZone 对象。

实例

创建新的 DateTimeZone 对象,然后返回时区的名称:

<?php
$tz=timezone_open("Asia/Shanghai");
echo timezone_name_get($tz);
?>

亲自试一试

语法

timezone_open(timezone);
参数 描述
timezone

必需。规定时区。

提示:查看 PHP 中支持的所有时区列表。

同类函数
热门文章